package projecteuler;

import java.util.ArrayList;

public class Problem25
{
    public static void main(String[] args)
    {
        long now = System.currentTimeMillis();
        ArrayList<String> fnMinus2 = new ArrayList<String>();
        fnMinus2.add("1");
        ArrayList<String> fnMinus1 = new ArrayList<String>();
        fnMinus1.add("1");
        ArrayList<String> fn = new ArrayList<String>();
        int i = 2;
        while (fn.size() < 1000)
        {
            i++;
            fn = getFibonacci(fnMinus1, fnMinus2);
            fnMinus2 = fnMinus1;
            fnMinus1 = fn;
        }
        System.out.println(i);
        System.out.println((System.currentTimeMillis() - now) + "ms");
    }

    private static ArrayList<String> getFibonacci(ArrayList<String> fnMinus1, ArrayList<String> fnMinus2)
    {
        return Utils.add(fnMinus1, fnMinus2);
    }
    
    
}
